TARGET = tinysim

CC = gcc
CFLAGS = -std=c99 -g -O0 -Wno-pointer-to-int-cast
INCLUDES += -I./core -I./perips
LDFLAGS = 

SRCS += ./core/core.c
SRCS += ./core/reg.c
SRCS += ./core/ex.c
SRCS += ./perips/rom.c
SRCS += ./perips/ram.c
SRCS += ./perips/uart.c
SRCS += ./bus/xbar.c
SRCS += main.c

OBJS := $(SRCS:.c=.o)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) $(INCLUDES) $(OBJS) -o $@ $(LDFLAGS)

app: $(TARGET)

.PHONY: clean
clean:
	rm -rf $(TARGET) $(OBJS)
